import request from "@/utils/request";


export function list(params){
    return request({
        url:'/role/selectAll',
        method:'get',
        params:params
    })
}

export function delRole(id){
    return request({
        url:'/role/delete/' + id,
        method:'get',
    })
}


export function deleteBatch(ids){
    return request({
        url:'/role/deleteBatch',
        method:'post',
        data:ids
    })
}

export function edit(roleId,data){
    return request({
        url:'/role/edit/'+roleId,
        method:'post',
        data:data
    })
}

export function save(data){
    return request({
        url:'/role/save',
        method:'post',
        data:data
    })
}


export function selectRoleMenuByRoleId(roleId){
    return request({
        url:'/role-menu/save/'+roleId,
        method:'get'
    })
}


export function saveRoleMenu(roleId,data){
    return request({
        url:'/role-menu/save/'+roleId,
        method:'post',
        data:data
    })
}



export function changeEnable(roleId,params){
    return request({
        url:'/role/edit/' + roleId,
        method:'get',
        params:params
    })
}

export function findAll(){
    return request({
        url:'/role/findAll',
        method:'get'
    })
}